<template>
	<view class="my-page">
		<u-navbar leftIconColor="#ffffff" :autoBack="true" :placeholder="true" bgColor="rgba(255,255,255,0.0)">
			<view slot="center" class="nav-title">
				收款方式
			</view>
		</u-navbar>
		<view class="pay-title">
			<view class="title"><text>收款</text>方式</view>
			<view class="mintitle">请填写真实姓名和账号信息</view>
		</view>
		<view class="sk-box">
			<view class="item">
				<view class="item-left">
					<image src="/static/home/pay1.png" mode=""></image>
					<view class="item-info" v-if="zfbinfo.account_num">
						<view class="name">
							{{zfbinfo.account_num}}
						</view>
					</view>
					<view class="item-info" v-else>
						<view class="name2">
							暂未开通支付宝收款
						</view>
					</view>
				</view>
				<view class="item-btn" @click="goSet(1)">
					<text v-if="zfbinfo.account_num">设置</text>
					<text v-else>立即开通</text>
				</view>
			</view>
			<view class="item">
				<view class="item-left">
					<image src="/static/home/pay2.png" mode=""></image>
					<view class="item-info" v-if="vxinfo.account_num">
						<view class="name">
							{{vxinfo.account_num}}
						</view>
					</view>
					<view class="item-info" v-else>
						<view class="name2">
							暂未开通微信收款
						</view>
					</view>
				</view>
				<view class="item-btn" @click="goSet(2)">
					<text v-if="vxinfo.account_num">设置</text>
					<text v-else>立即开通</text>
				</view>
			</view>
			<view class="item">
				<view class="item-left">
					<image src="/static/home/pay3.png" mode=""></image>
					<view class="item-info" v-if="bankinfo.bank_num">
						<view class="name">
							{{bankinfo.bank_num}}
						</view>
					</view>
					<view class="item-info" v-else>
						<view class="name2">
							暂未开通银联收款
						</view>
					</view>
				</view>
				<view class="item-btn" @click="goSet(3)">
					<text v-if="bankinfo.bank_num">设置</text>
					<text v-else>立即开通</text>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				zfbinfo: {},
				vxinfo: {},
				bankinfo: {}
			}
		},
		onShow() {
			this.getInfozfb()
			this.getInfovx()
			this.getInfobank()
		},
		methods: {
			getInfobank() {
				let params = {
					type: 3
				}
				this.$Request({
					method: 'POST',
					url: '/api/personal/paymentInfo',
					data: params,
					ismsg: false,
				}).then(res => {
					if (res.code == 1) {
						this.bankinfo = res.data
					}
				})
			},
			getInfovx() {
				let params = {
					type: 2
				}
				this.$Request({
					method: 'POST',
					url: '/api/personal/paymentInfo',
					data: params,
					ismsg: false,
				}).then(res => {
					if (res.code == 1) {
						this.vxinfo = res.data
					}
				})
			},
			getInfozfb() {
				let params = {
					type: 1
				}
				this.$Request({
					method: 'POST',
					url: '/api/personal/paymentInfo',
					data: params,
					ismsg: false,
				}).then(res => {
					if (res.code == 1) {
						this.zfbinfo = res.data
					}
				})
			},
			goSet(id) {
				uni.navigateTo({
					url: '/pages/my/receive/set?id=' + id
				})
			}
		}
	}
</script>
<style>
	page{
		background: #000000;
	}
</style>
<style lang="scss" scoped>
	.my-page {
		height: 100vh;
		position: relative;
		background-image: url('../../../static/login/login-bg.png');
		background-repeat: no-repeat;
		background-size: 100% 593px;
		padding: 30rpx;

		.nav-title {
			color: #ffffff;
		}

		.pay-title {
			text-align: center;
			padding: 60rpx 0rpx;
			.title {
				font-size: 32px;
				font-weight: 900;
				color: #fff;
			}

			.mintitle {
				font-size: 12px;
				margin-top: 10rpx;
				color: #999;
			}
		}

		.sk-box {
			.item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 30rpx;
				border-radius: 30rpx;
				background: linear-gradient(0deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05)),
				linear-gradient(0deg, #1A1A1B, #1A1A1B);
				margin-bottom: 30rpx;

				.item-left {
					text-align: center;
					display: flex;
					align-items: center;
					image {
						width: 100rpx;
						height: 100rpx;
						margin-right: 30rpx;
					}

					.item-info {
						font-size: 28rpx;
						.name {
							color: #ffffff;
						}
						.name2 {
							color: #999;
						}
					}
				}

				.item-btn {
					text-align: center;
					color: #fff;
					font-size: 24rpx;
				}
			}
		}
	}
</style>